<template>
	<view>
		<navbar :isback="true" title="我的钱包"></navbar>
		<view class="con">
			<view class="con__top">
				<image src="/static/my/qbtopbg.png" class="con__top__bg" mode=""></image>
				<view class="" style="position: relative;">
					<view class="con__top__title">
						我的余额
					</view>
					<view class="con__top__value">
						￥ {{info.money}}
					</view>
					<view class="con__top__bottom">
						<view class="con__top__bottom__item" @click="to('/pages/msg/proportion')" v-if="info.rate">
							<view class="con__top__bottom__item__text u-flex u-flex-y-center">
								分成比例 <u-icon name="arrow-right" color="#FFFAF7" size="20rpx"></u-icon>
							</view>
							<view class="con__top__bottom__item__value">
								{{info.rate}}%
							</view>
						</view>
						<view class="con__top__bottom__item">
							<view class="con__top__bottom__item__text">
								我的总分成
							</view>
							<view class="con__top__bottom__item__value">
								{{info.totalDivide}}
							</view>
						</view>
						<view class="con__top__bottom__item">
							<view class="con__top__bottom__item__text">
								我的总提现
							</view>
							<view class="con__top__bottom__item__value">
								{{info.withdraw}}
							</view>
						</view>
					</view>
				</view>
				<view class="con__top__btn" hover-class="hover-class" @click="to('/pages/my/withdrawal?money='+info.money)">
					<image src="/static/my/tx.png" class="con__top__btn__icon" mode=""></image>
					点击提现
				</view>
			</view>



		</view>
		<view class="title">
			我的账单
		</view>
		<view class="list">
			<view class="list__item" v-for="(item,index) in list" :key="index">
				<u-icon name="/static/my/qb.png" size="97rpx"></u-icon>
				<view class="list__item__center">
					<view class="list__item__text">
						{{item.memo}}
					</view>
					<view class="list__item__time">
						<!-- 2024/05/23 16:25 -->
						{{item.createtime}}
					</view>
				</view>
				<view class="list__item__value">
					+{{item.money}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import user from '@/api/_user.js'
	export default {
		data() {
			return {
				info:{},
				list:[]
			};
		},
		onShow() {
			user.moneyLogList().then(res=>{
				if(res.data.code==1){
					this.info=res.data.data
					this.list=res.data.data.list
				}
			})
		}
	}
</script>

<style lang="scss">
	.con {
		padding: 40rpx 30rpx;

		&__top {
			width: 690rpx;
			height: 382rpx;
			position: relative;
			overflow: hidden;

			&__bg {
				width: 690rpx;
				height: 382rpx;
				position: absolute;
				top: 0;
				left: 0;
			}

			&__title {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 25rpx;
				color: #FFFFFF;
				line-height: 25rpx;
				padding: 56rpx 0 63rpx 50rpx;
			}

			&__value {
				font-family: PingFang SC;
				font-weight: 800;
				font-size: 50rpx;
				color: #FFFFFF;
				line-height: 42rpx;
				padding-left: 48rpx;
			}

			&__bottom {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-top: 70rpx;

				&__item {
					width: 33.33%;
					display: flex;
					flex-direction: column;
					align-items: center;

					&__text {
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 24rpx;
						color: #FFFFFF;
						line-height: 24rpx;
						margin-bottom: 20rpx;
					}

					&__value {
						font-family: PingFang SC;
						font-weight: 800;
						font-size: 36rpx;
						color: #FFFFFF;
						line-height: 28rpx;
					}
				}
			}

			&__btn {
				width: 254rpx;
				height: 70rpx;
				background-color: #FCCB05;
				position: absolute;
				right: -30rpx;
				top: 133rpx;
				border-radius: 35rpx 0 0 35rpx;
				display: flex;
				align-items: center;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #FFFFFF;

				&__icon {
					width: 39rpx;
					height: 39rpx;
					margin-left: 25rpx;
					margin-right: 15rpx;
				}
			}
		}
	}

	.hover-class {
		opacity: 0.8;
	}

	.list {
		padding: 12rpx 0 0 30rpx;
		border-bottom: 1rpx solid #F4F5F6;

		&__item {
			display: flex;
			align-items: center;
			padding-right: 30rpx;
			border-bottom: 1rpx solid #F4F5F6;
			height: 160rpx;

			&__center {
				flex: 1;
				margin-left: 20rpx;
			}

			&__text {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 30rpx;
				color: #1E1E1E;
				line-height: 40rpx;
			}

			&__time {
				font-family: PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #727070;
				line-height: 40rpx;
			}

			&__value {
				font-family: DIN Next LT Pro;
				font-weight: bold;
				font-size: 36rpx;
				color: #FA4600;
				line-height: 36rpx;
			}
			&__value2 {
				font-family: DIN Next LT Pro;
				font-weight: bold;
				font-size: 36rpx;
				color: #333333;
				line-height: 36rpx;
			}
			&:last-child {
				border-bottom: 0;
			}
		}
	}

	.title {
		font-family: PingFang SC;
		font-weight: 800;
		font-size: 30rpx;
		color: #3F3F3F;
		line-height: 30rpx;
		padding-left: 32rpx;
	}
</style>